<?php
if ( ! defined('BASEPATH')) exit('No direct script access allowed');
Class ObjectMap_helper{
	
	private static $mapper = array();
	
	public static function getMapper($object_class){
		$mapper = self::getMapperClass($object_class);
		if(!isset(self::$mapper[$mapper])){
			$mapper_instance = new $mapper;
			self::$mapper[$mapper] = $mapper_instance;
		}
		return self::$mapper[$mapper];
	}
	public static function resetMapper(){
		self::$mapper = array();
	}
	public static function getMapperClass($class){
		return ucfirst(str_replace('object', 'mapper', strtolower($class)));
	}
}